#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# author: maxiao
# date: 2023-04-01 15:36
# description: 创建子进程

import threading
import time


def test():
    print("当前的线程名称是：{}".format(threading.current_thread().name))
    time.sleep(3)


if __name__ == "__main__":
    print("{}线程开始执行...".format(threading.current_thread().name))
    theard = threading.Thread(target=test)
    # 可指定参数name，设置进程名称
    # theard = threading.Thread(target=test, name='新线程')
    theard.start()
    theard.join()
    print("{}线程完成执行...".format(threading.current_thread().name))

    
